//导入mongoose
const mongoose = require('mongoose');

function register() {
    let regSchema = new mongoose.Schema({
        username: {
            type: String,
            required: true,//键值(必填项)
            unique: true
        },
        password: {
            type: String,
            required: true
        },
        time: Date
    });
    return mongoose.model('register', regSchema);
}

// 暴漏
exports.register = register;